/****** Object: View [dbo].[vw_4_7_1]   Script Date: 2014-01-19 21:47:58 ******/
USE [SHMIS];
GO
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[vw_4_7_1]'))
BEGIN
DROP VIEW [dbo].[vw_4_7_1];
END
GO

SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE VIEW [dbo].[vw_4_7_1]
AS
   SELECT ri.Customer_Code,
          ri.Contract_Num,
          ri.[Year],
          ri.[Month],
          ri.Serial_Num,
          ri.Customer_Simple_Code,
          ri.Customer_Simple_Name,
          ri.[Date],
          ri.Amount,
          ri.Amount_Type,
          ri.Duration_Begin,
          ri.Duration_End,
          ri.Actual_Date,
          ri.Actual_Amount,
          ri.Operate_Status,
          ri.Credit_Comment,
          ri.Is_From_Other,
          ri.Is_From_Last,
          ri.Comments,
          ri.Depart_Id,
          ri.cre_user,
          ri.cre_date,
          ri.chg_user,
          ri.chg_date,
          ri.verified,
          ri.verify_user,
          ri.deleted,
          ri.Vfy_Serial_Num,
          ri.AR_SerialNum,
          dar.Record_Check
     FROM HD_RealIncome ri, HD_DeductibleARManage dar
    WHERE     ri.AR_SerialNum = dar.Serial_Num
          AND ri.Customer_Code = dar.Customer_Code
          AND ri.Contract_Num = dar.Contract_Num
          AND ri.verified = '1'
          AND ri.deleted = '0'
          AND dar.Verified = '1'
          AND dar.Deleted = '0'
GO

